<!DOCTYPE html>
<html lang="en">
  <head>
    <title>OpenMode Enum Reference</title>
    <link rel="stylesheet" type="text/css" href="../../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../../css/highlight.css" />
    <meta charset="utf-8">
    <script src="../../js/jquery.min.js" defer></script>
    <script src="../../js/jazzy.js" defer></script>
    
  </head>
  <body>

    <a name="//apple_ref/swift/Enum/OpenMode" class="dashAnchor"></a>

    <a title="OpenMode Enum Reference"></a>

    <header class="header">
      <p class="header-col header-col--primary">
        <a class="header-link" href="../../index.html">
          PerfectLib Docs
        </a>
         (70% documented)
      </p>
    
        <p class="header-col header-col--secondary">
          <a class="header-link" href="https://github.com/PerfectlySoft/Perfect">
            <img class="header-icon" src="../../img/gh.png"/>
            View on GitHub
          </a>
        </p>
    
    </header>

    <p class="breadcrumbs">
      <a class="breadcrumb" href="../../index.html">PerfectLib Reference</a>
      <img class="carat" src="../../img/carat.png" />
      OpenMode Enum Reference
    </p>

    <div class="content-wrapper">
      <nav class="navigation">
        <ul class="nav-groups">
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../../Classes.html">Classes</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Classes/Bytes.html">Bytes</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Classes/File.html">File</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Classes/File/OpenMode.html">– OpenMode</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Classes/HTTP2Client.html">HTTP2Client</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Classes/HTTPServer.html">HTTPServer</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Classes/JSONConvertibleObject.html">JSONConvertibleObject</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Classes/JSONDecoding.html">JSONDecoding</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Classes/MimeReader.html">MimeReader</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Classes/MimeReader/BodySpec.html">– BodySpec</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Classes/MustacheEvaluationContext.html">MustacheEvaluationContext</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Classes/MustacheEvaluationOutputCollector.html">MustacheEvaluationOutputCollector</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Classes/MustacheGroupTag.html">MustacheGroupTag</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Classes/MustacheParser.html">MustacheParser</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Classes/MustachePartialTag.html">MustachePartialTag</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Classes/MustachePragmaTag.html">MustachePragmaTag</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Classes/MustacheTag.html">MustacheTag</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Classes/MustacheTemplate.html">MustacheTemplate</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Classes/SysProcess.html">SysProcess</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Classes/TemporaryFile.html">TemporaryFile</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../../Global Variables.html">Global Variables</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Global Variables.html#/s:v10PerfectLib10fileStderrCS_4File">fileStderr</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Global Variables.html#/s:v10PerfectLib9fileStdinCS_4File">fileStdin</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Global Variables.html#/s:v10PerfectLib10fileStdoutCS_4File">fileStdout</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Global Variables.html#/s:v10PerfectLib22serverPerfectLibrariesSS">serverPerfectLibraries</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../../Enums.html">Enums</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Enums/HTTPFilterPriority.html">HTTPFilterPriority</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Enums/HTTPMethod.html">HTTPMethod</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Enums/HTTPRequestFilterResult.html">HTTPRequestFilterResult</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Enums/HTTPRequestHeader.html">HTTPRequestHeader</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Enums/HTTPRequestHeader/Name.html">– Name</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Enums/HTTPResponseFilterResult.html">HTTPResponseFilterResult</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Enums/HTTPResponseHeader.html">HTTPResponseHeader</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Enums/HTTPResponseHeader/Name.html">– Name</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Enums/HTTPResponseStatus.html">HTTPResponseStatus</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Enums/JSONConversionError.html">JSONConversionError</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Enums/MustacheError.html">MustacheError</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Enums/PerfectError.html">PerfectError</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../../Extensions.html">Extensions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Extensions/Array.html">Array</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Extensions/Bool.html">Bool</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Extensions/Dictionary.html">Dictionary</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Extensions/Double.html">Double</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Extensions/Int.html">Int</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Extensions/NetNamedPipe.html">NetNamedPipe</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Extensions/Optional.html">Optional</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Extensions/String.html">String</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Extensions/UInt.html">UInt</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Extensions/UnicodeScalar.html">UnicodeScalar</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../../Functions.html">Functions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Functions.html#/s:ZF10PerfectLiboi2eeFTOOS_17HTTPRequestHeader4NameS1__Sb">==(_:_:)</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Functions.html#/s:ZF10PerfectLiboi2eeFTOOS_18HTTPResponseHeader4NameS1__Sb">==(_:_:)</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Functions.html#/s:ZF10PerfectLiboi2eeFTOS_10HTTPMethodS0__Sb">==(_:_:)</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Functions.html#/s:F10PerfectLib10empty_uuidFT_TVs5UInt8S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0__">empty_uuid()</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Functions.html#/s:F10PerfectLib10formatDateFzTSd6formatSS8timezoneGSqSS_6localeGSqSS__SS">formatDate(_:format:timezone:locale:)</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Functions.html#/s:F10PerfectLib6getNowFT_Sd">getNow()</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Functions.html#/s:F10PerfectLib16icuDateToSecondsFSdSi">icuDateToSeconds(_:)</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Functions.html#/s:F10PerfectLib15mustacheRequestFT7requestPS_11HTTPRequest_8responsePS_12HTTPResponse_7handlerPS_19MustachePageHandler_12templatePathSS_T_">mustacheRequest(request:response:handler:templatePath:)</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Functions.html#/s:F10PerfectLib11random_uuidFT_TVs5UInt8S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0_S0__">random_uuid()</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Functions.html#/s:F10PerfectLib16secondsToICUDateFSiSd">secondsToICUDate(_:)</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../../Protocols.html">Protocols</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Protocols/HTTPRequest.html">HTTPRequest</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Protocols/HTTPRequestFilter.html">HTTPRequestFilter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Protocols/HTTPResponse.html">HTTPResponse</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Protocols/HTTPResponseFilter.html">HTTPResponseFilter</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Protocols/HeaderListener.html">HeaderListener</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Protocols/JSONConvertible.html">JSONConvertible</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Protocols/MustachePageHandler.html">MustachePageHandler</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../../Structs.html">Structs</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Structs/Dir.html">Dir</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Structs/Encoding.html">Encoding</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Structs/GenerateFromPointer.html">GenerateFromPointer</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Structs/HTTPCookie.html">HTTPCookie</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Structs/HTTPCookie/Expiration.html">– Expiration</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Structs/JSONConvertibleNull.html">JSONConvertibleNull</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Structs.html#/s:V10PerfectLib3Log">Log</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Structs/MimeType.html">MimeType</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Structs/MimeType/TopType.html">– TopType</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Structs/PerfectServer.html">PerfectServer</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Structs/RouteMap.html">RouteMap</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Structs/Routing.html">Routing</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Structs/StaticFileHandler.html">StaticFileHandler</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../../Structs/UTF8Encoding.html">UTF8Encoding</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">

        <section class="section">
          <div class="section-content">
            <h1>OpenMode</h1>
              <div class="declaration">
                <div class="language">
                  <pre class="highlight"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">OpenMode</span></code></pre>

                </div>
              </div>
            <p>The open mode for the file.</p>

          </div>
        </section>

        <section class="section">
          <div class="section-content">
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FOC10PerfectLib4File8OpenMode4readFMS1_S1_"></a>
                    <a name="//apple_ref/swift/Element/read" class="dashAnchor"></a>
                    <a class="token" href="#/s:FOC10PerfectLib4File8OpenMode4readFMS1_S1_">read</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Opens the file for read-only access.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="k">case</span> <span class="n">read</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FOC10PerfectLib4File8OpenMode5writeFMS1_S1_"></a>
                    <a name="//apple_ref/swift/Element/write" class="dashAnchor"></a>
                    <a class="token" href="#/s:FOC10PerfectLib4File8OpenMode5writeFMS1_S1_">write</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Opens the file for write-only access, creating the file if it did not exist.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="k">case</span> <span class="n">write</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FOC10PerfectLib4File8OpenMode9readWriteFMS1_S1_"></a>
                    <a name="//apple_ref/swift/Element/readWrite" class="dashAnchor"></a>
                    <a class="token" href="#/s:FOC10PerfectLib4File8OpenMode9readWriteFMS1_S1_">readWrite</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Opens the file for read-write access, creating the file if it did not exist.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="k">case</span> <span class="n">readWrite</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FOC10PerfectLib4File8OpenMode6appendFMS1_S1_"></a>
                    <a name="//apple_ref/swift/Element/append" class="dashAnchor"></a>
                    <a class="token" href="#/s:FOC10PerfectLib4File8OpenMode6appendFMS1_S1_">append</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Opens the file for read-write access, creating the file if it did not exist and moving the file marker to the end.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="k">case</span> <span class="n">append</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:FOC10PerfectLib4File8OpenMode8truncateFMS1_S1_"></a>
                    <a name="//apple_ref/swift/Element/truncate" class="dashAnchor"></a>
                    <a class="token" href="#/s:FOC10PerfectLib4File8OpenMode8truncateFMS1_S1_">truncate</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Opens the file for read-write access, creating the file if it did not exist and setting the file&rsquo;s size to zero.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight"><code><span class="k">case</span> <span class="n">truncate</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
          </div>
        </section>

      </article>
    </div>
    <section class="footer">
      <p>© 2016 PerfectlySoft Inc. and the Perfect project authors</p>
      <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.0</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
    </section>
  </body>
</div>
</html>
